Public Class modificarEstudiante

    Private gestor As capaNegocios.Gestor = gestor.instanciar
    Private idE, idG As Integer

    Public Sub cargarDatos(ByVal pnom As String, ByVal pape As String, ByVal pcar As String, ByVal pmail As String, ByVal ppass As String, ByVal pidE As Integer, ByVal pidG As Integer)
        Me.nombre.Text = pnom
        Me.apellidos.Text = pape
        Me.email.Text = pmail
        Me.carne.Text = pcar
        Me.password.Text = ppass
        Me.idE = pidE
        Me.idG = pidG
    End Sub

    Private Sub Modificar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim _nombre, _apellidos, _carne, _email, _pass As String
        _nombre = nombre.Text
        _apellidos = apellidos.Text
        _carne = carne.Text
        _email = email.Text
        _pass = password.Text
        Try
            gestor.modificarEstudiante(_nombre, _apellidos, _carne, _email, Me.idG, Me.idE, _pass)
            Me.DialogResult = Windows.Forms.DialogResult.OK
            MessageBox.Show("Fue actualizado satisfactoriamente", "", MessageBoxButtons.OK, MessageBoxIcon.Information)
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error de Formato", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Me.DialogResult = Windows.Forms.DialogResult.None
        End Try

    End Sub


    Private Sub Cancelar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Close()
    End Sub
End Class